/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.urbainski.estagio.entidade;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Cristian Elder Urbainski
 * @since 11/12/2011
 */
@Entity
@Table(name = "turmaprofessor")
public class Turmaprofessor implements Serializable {
   
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_turmaprofessor")
    private Integer idTurmaprofessor;
    
    @Column(name = "id_professor")
    private Integer idProfessor;
    
    @Column(name = "id_turma")
    private Integer idTurma;

    @JoinColumn(name = "id_turma", referencedColumnName = "id_turma", insertable = false, updatable= false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Turma turma;
    
    @JoinColumn(name = "id_professor", referencedColumnName = "id_professor", insertable = false, updatable= false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Professor professor;

    public Integer getIdProfessor() {
        return idProfessor;
    }

    public void setIdProfessor(Integer idProfessor) {
        this.idProfessor = idProfessor;
    }

    public Integer getIdTurma() {
        return idTurma;
    }

    public void setIdTurma(Integer idTurma) {
        this.idTurma = idTurma;
    }

    public Integer getIdTurmaprofessor() {
        return idTurmaprofessor;
    }

    public void setIdTurmaprofessor(Integer idTurmaprofessor) {
        this.idTurmaprofessor = idTurmaprofessor;
    }

    public Professor getProfessor() {
        return professor;
    }

    public void setProfessor(Professor professor) {
        this.professor = professor;
    }

    public Turma getTurma() {
        return turma;
    }

    public void setTurma(Turma turma) {
        this.turma = turma;
    }

}
